import Vue from "vue";

import JModal from "./JModal";
import JPrompt from "./JPrompt";


Vue.component("j-modal", JModal);

const JPromptExtend = Vue.extend(JPrompt);
Vue.prototype.$JPrompt = function (options = {}) {
  // 创建prompt实例
  const vm = new JPromptExtend().$mount();
  vm.show(options);
  // 关闭后销毁
  vm.$on("after-close", () => vm.$destroy());
  return vm;
};
